cmake_minimum_required(VERSION 3.0.0)

project(read_cgns_file_parallel)

message(STATUS "PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
message(STATUS "PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}")

find_package(MPI REQUIRED)

find_library(cgns_lib cgns /usr/local/cgns/lib)
find_library(hdf5_lib hdf5 /usr/local/hdf5-1.8.21/lib)
# find_library(hdf5_lib hdf5 /usr/local/hdf5/lib)
# find_library(hdf5_hl_lib hdf5_hl /usr/local/hdf5/lib)

message("cgns_lib cgns  ${cgns_lib}")
message("hdf5_lib hdf5  ${hdf5_lib}")
# find_path(cgns_inc cgnslib.h /usr/local/cgnsSerial/include)
# find_path(hdf5_inc hdf5.h /usr/local/hdf5/include)

# find_path(hdf5_inc )
# find_path(hdf5_inc hdf5.h /usr/local/cgns/include)

include_directories(${MPI_INCLUDE_PATH})
message(STATUS "Using MPI_INCLUDE_PATH: ${MPI_INCLUDE_PATH}")
message(STATUS "Using MPI_C_LIBRARIES: ${MPI_LIBRARIES}")

include_directories(/usr/local/cgns/include)
include_directories(/usr/local/hdf5-1.8.21/include)

set(source_list 
    ../write_flowcentrind_str_paroverzone.c
)

# set(source_list 
# test.cpp
# cgnsUtilities.cpp
# )

set(CMAKE_BUILD_TYPE Debug)

set(exe_name "write.out")

# set(exe_name "test.out")

add_executable(${exe_name} ${source_list})

target_link_libraries(${exe_name} ${cgns_lib} ${hdf5_lib} ${MPI_LIBRARIES}) 

